package org.kabeja.dxf;

import java.util.HashMap;
import java.util.Iterator;

/**
 * @author shutao
 * @since 2022/4/25 10:31
 */
public class DXFDimensionStyle {
    public static final String PROPERTY_DIMTXT = "140";
    public static final String PROPERTY_DIMLDRBLK = "341";
    public static final String PROPERTY_DIMCLRD = "176";
    public static final String PROPERTY_DIMASZ = "41";
    public static final String PROPERTY_DIMGAP = "147";
    public static final String PROPERTY_DIMSCALE = "40";
    public static final String PROPERTY_DIMTXSTY = "340";
    public static final String PROPERTY_DIMLWD = "371";
    public static final String PROPERTY_DIMADEC = "179";
    public static final String PROPERTY_DIMALT = "170";
    public static final String PROPERTY_DIMALTD = "171";
    public static final String PROPERTY_DIMALTF = "143";
    public static final String PROPERTY_DIMALTRND = "148";
    public static final String PROPERTY_DIMALTTD = "274";
    public static final String PROPERTY_DIMALTTZ = "286";
    public static final String PROPERTY_DIMALTU = "273";
    public static final String PROPERTY_DIMALTZ = "285";
    public static final String PROPERTY_DIMAPOST = "4";
    public static final String PROPERTY_DIMATFIT = "289";
    public static final String PROPERTY_DIMUNIT = "275";
    public static final String PROPERTY_DIMAZIN = "79";
    public static final String PROPERTY_DIMBLK = "342";
    public static final String PROPERTY_DIMBLK1 = "343";
    public static final String PROPERTY_DIMBLK2 = "344";
    public static final String PROPERTY_DIMCEN = "141";
    public static final String PROPERTY_DIMCLRE = "177";
    public static final String PROPERTY_DIMCLRT = "178";
    public static final String PROPERTY_DIMDEC = "271";
    public static final String PROPERTY_DIMDLE = "46";
    public static final String PROPERTY_DIMDLI = "43";
    public static final String PROPERTY_DIMDSEP = "278";
    public static final String PROPERTY_DIMEXE = "44";
    public static final String PROPERTY_DIMEXO = "42";
    public static final String PROPERTY_DIMFRAC = "276";
    public static final String PROPERTY_DIMJUST = "280";
    public static final String PROPERTY_DIMLFAC = "144";
    public static final String PROPERTY_DIMLIM = "72";
    public static final String PROPERTY_DIMLUNIT = "277";
    public static final String PROPERTY_DIMLWE = "372";
    public static final String PROPERTY_DIMPOST = "3";
    public static final String PROPERTY_DIMMD = "45";
    public static final String PROPERTY_DIMSAH = "173";
    public static final String PROPERTY_DIMSD1 = "281";
    public static final String PROPERTY_DIMSD2 = "282";
    public static final String PROPERTY_DIMSE1 = "75";
    public static final String PROPERTY_DIMSE2 = "76";
    public static final String PROPERTY_DIMSOXD = "175";
    public static final String PROPERTY_DIMRAD = "77";
    public static final String PROPERTY_DIMTDEC = "272";
    public static final String PROPERTY_DIMDTFAC = "146";
    public static final String PROPERTY_DIMTIH = "73";
    public static final String PROPERTY_DIMTIX = "174";
    public static final String PROPERTY_DIMDIMTM = "48";
    public static final String PROPERTY_DIMTMOVE = "289";
    public static final String PROPERTY_DIMTOFL = "172";
    public static final String PROPERTY_DIMTOH = "74";
    public static final String PROPERTY_DIMTOL = "71";
    public static final String PROPERTY_DIMTOLJ = "283";
    public static final String PROPERTY_DIMTP = "47";
    public static final String PROPERTY_DIMTSZ = "142";
    public static final String PROPERTY_DIMTVP = "145";
    public static final String PROPERTY_DIMTZIN = "284";
    public static final String PROPERTY_DIMZIN = "78";
    private HashMap properties = new HashMap();
    private int flags = 0;
    private String name = "";

    public DXFDimensionStyle() {
    }

    public void setProperty(String var1, String var2) {
        this.properties.put(var1, var2);
    }

    public boolean hasProperty(String var1) {
        return this.properties.containsKey(var1);
    }

    public String getProperty(String var1) {
        return (String)this.properties.get(var1);
    }

    public int getIntegerProperty(String var1) {
        String var2 = (String)this.properties.get(var1);
        return Integer.parseInt(var2);
    }

    public int getIntegerProperty(String var1, int var2) {
        if (this.hasProperty(var1)) {
            String var3 = (String)this.properties.get(var1);
            return Integer.parseInt(var3);
        } else {
            return var2;
        }
    }

    public double getDoubleProperty(String var1) {
        String var2 = (String)this.properties.get(var1);
        return Double.parseDouble(var2);
    }

    public double getDoubleProperty(String var1, double var2) {
        if (this.hasProperty(var1)) {
            String var4 = (String)this.properties.get(var1);
            return Double.parseDouble(var4);
        } else {
            return var2;
        }
    }

    public boolean getBooleanProperty(String var1) {
        String var2 = (String)this.properties.get(var1);
        return "1".equals(var2);
    }

    public boolean getBooleanProperty(String var1, boolean var2) {
        if (this.hasProperty(var1)) {
            String var3 = (String)this.properties.get(var1);
            return "1".equals(var3);
        } else {
            return var2;
        }
    }

    public Iterator getPropertyIterator() {
        return this.properties.values().iterator();
    }

    public String getName() {
        return this.name;
    }

    public void setName(String var1) {
        this.name = var1;
    }

    public void setFlags(int var1) {
        this.flags = var1;
    }

    public int getFlags() {
        return this.flags;
    }
}
